package com.cszb.controller;

import com.cszb.UserController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;


/**
 * @author:CrazyShaQiuShi
 * @email: 1047812462@qq.com
 * @createTime: 2018-9-30 16:52
 * @version: 1.0
 */
@RestController
@RequestMapping("/test")
public class UserTestController {
    @Autowired
    private FeignDemoProvider feignDemoProvider;

    @RequestMapping("/sayHello")
    public String sayHello() {
        return feignDemoProvider.sayHello();
    }

    @RequestMapping("/userName")
    public String userName(@RequestParam(name = "userName") String userName) {
        return feignDemoProvider.userName(userName);
    }

    @FeignClient(name = "cszb-sc-rpc-server")
    public interface FeignDemoProvider extends UserController {
    }
}
